// g++ -o virtual_inheritance virtual_inheritance.cc
#include <iostream>
using namespace std;
class A {
  char k[3];

 public:
  virtual void aa(){

  };
};
class B : public virtual A {
  char j[3];

 public:
  virtual void bb(){

  };
};
class C : public virtual B {
  char i[3];

 public:
  virtual void cc(){

  };
};
class D : public C, B {};
int main() {
  cout << sizeof(A) << endl;
  cout << sizeof(B) << endl;
  cout << sizeof(C) << endl;
  cout << sizeof(D) << endl;
  return 0;
}